<%if session[:admin]%>
<div id="list">

<h1><font color="White">Listing locations</font></h1>


<table class="wide-table"> 
  <tr>
    <th>Username</th>
    <th>Phonenumber</th>
    <th>Latitude</th>
    <th>Longitude</th>
    <th>Date</th>
    <th>Commtype</th>
  </tr>

<% @locations.each do |location| %>
  <tr class="<%= cycle('list-line-odd', 'list-line-even') %>">
    <td><%=h location.username %></td>
    <td><%=h location.phonenumber %></td>
    <td><%=h location.latitude %></td>
    <td><%=h location.longitude %></td>
    <td><%=h location.time %></td>
    <td><%=h location.commType %></td>
    <td><%= link_to 'Show', location %></td>
    <td><%= link_to 'Edit', edit_location_path(location) %></td>
    <td><%= link_to 'Destroy', location, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>
</div>

<br />

<%= link_to 'New location', new_location_path %>
<%end%>
